<template>
    <el-dialog v-dialogDrag title="菜单授权" :visible="menuShow" width="40%" @close="dialogClose"
        :close-on-click-modal="false">
        <el-tree :data="dataTree" show-checkbox @node-click="handleNodeClick" :expand-on-click-node="false">
            <span class="tree-node" slot-scope="{data}">
                <span>{{ data.nameZh }}</span>
            </span>
        </el-tree>
        <el-button type="primary" @click="submit" class="pull-right margin-l-25">确定
        </el-button>
        <el-button @click="dialogClose" class="pull-right">取消</el-button>
    </el-dialog>
</template>

<script>
import { getAll } from "@/api/systemManage/menuManage";
export default {
    name: 'Power',
    data () {
        return {
            dataTree:[]
        }
    },
    props: {
        id: {
            type: Number
        },
        menuShow: {
            type: Boolean
        },
    },

    methods: {
        dialogClose () {
            this.$emit("dialogClose");
        },
        submit(){
            
        }
    },
    mounted(){
        getAll().then((res)=>{
            this.dataTree=res.data
        })
    }
};
</script>

<style lang="less" scoped>
.el-tree{
    padding-bottom: 20px;
}
</style>
